﻿using Prism.Commands;
using Prism.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrismDialog
{
    public class MainViewModel
    {
        public DelegateCommand OpenCommand { get; set; }

        
        IEventAggregator _eventAggregator;

        public MainViewModel(IEventAggregator eventAggregator)
        {
            _eventAggregator = eventAggregator;
            OpenCommand = new DelegateCommand(OnOpen);
        }

        private void OnOpen()
        {
            //使用消息（事件总线）的方式处理
            _eventAggregator.GetEvent<OpenMessage>().Publish("");










            //不使用消息（事件总线）的方式处理（PrismDialog_IDialogService项目）
            //使用DialogService
        }
    }
}
